import React from 'react';
import RouterView from '../../router/RouterView';
import { Layout, Menu} from 'antd';
import { useHistory } from 'react-router-dom'


const { Sider, Content } = Layout;

function StaffCenter(props) {
    
    var {routes} =props;

    var history = useHistory()
    
    var handleClick=({ item, key, keyPath, domEvent })=>{
        history.push(key)
    }

    return (
        
        <Layout className='staffcenter'>
                <Sider>
                    <Menu
                        theme="light"
                        defaultSelectedKeys={['/index/staffCenter/staffManage']}
                        style={{ lineHeight: '64px' }}
                        onClick={handleClick}
                    >
                        <Menu.Item key="/index/staffCenter/staffManage">员工管理</Menu.Item>
                        <Menu.Item key="/index/staffCenter/roleManage">角色权限管理</Menu.Item>
                    </Menu>
                </Sider>
                <Content>
                    {/* 渲染三级路由规则 */}
                    <RouterView routes={routes}></RouterView>
                </Content>
        </Layout>
            
        
    );
}

export default StaffCenter;